

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=&#34;auto&#34;>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/favicon.png">
  <link rel="icon" href="/img/favicon.png">
  <meta name="viewport"
        content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="description" content="">
  <meta name="author" content="John Doe">
  <meta name="keywords" content="">
  
  <title>ECFR107(Div.2)2021.04.13 - violet apricity</title>

  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" />


  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css@4.0.0/github-markdown.min.css" />
  <link  rel="stylesheet" href="/lib/hint/hint.min.css" />

  
    
    
      
      <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@10.4.0/styles/github-gist.min.css" />
    
  

  
    <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
  



<!-- 主题依赖的图标库，不要自行修改 -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_ba1fz6golrf.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_kmeydafke9r.css">


<link  rel="stylesheet" href="/css/main.css" />

<!-- 自定义样式保持在最底部 -->


  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    var CONFIG = {"hostname":"example.com","root":"/","version":"1.8.9","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"right","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"copy_btn":true,"image_zoom":{"enable":true},"toc":{"enable":true,"headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null}}};
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
<meta name="generator" content="Hexo 5.4.0"></head>


<body>
  <header style="height: 70vh;">
    <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand"
       href="/">&nbsp;<strong>violet apricity</strong>&nbsp;</a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" data-toggle="modal" data-target="#modalSearch">&nbsp;<i
                class="iconfont icon-search"></i>&nbsp;</a>
          </li>
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" href="javascript:">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

    <div class="banner" id="banner" parallax=true
         style="background: url('/img/default.png') no-repeat center center;
           background-size: cover;">
      <div class="full-bg-img">
        <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
          <div class="page-header text-center fade-in-up">
            <span class="h2" id="subtitle" title="ECFR107(Div.2)2021.04.13">
              
            </span>

            
              <div class="mt-3">
  
  
    <span class="post-meta">
      <i class="iconfont icon-date-fill" aria-hidden="true"></i>
      <time datetime="2021-04-16 11:01" pubdate>
        2021年4月16日 上午
      </time>
    </span>
  
</div>

<div class="mt-1">
  
    
    <span class="post-meta mr-2">
      <i class="iconfont icon-chart"></i>
      1.7k 字
    </span>
  

  
    
    <span class="post-meta mr-2">
      <i class="iconfont icon-clock-fill"></i>
      
      
      24
       分钟
    </span>
  

  
  
</div>

            
          </div>

          
        </div>
      </div>
    </div>
  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="d-none d-lg-block col-lg-2"></div>
    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div class="py-5" id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">ECFR107(Div.2)2021.04.13</h1>
            
            <div class="markdown-body">
              <h1 id="Educational-Codeforces-Round-107-Rated-for-Div-2"><a href="#Educational-Codeforces-Round-107-Rated-for-Div-2" class="headerlink" title="Educational Codeforces Round 107 (Rated for Div. 2)"></a>Educational Codeforces Round 107 (Rated for Div. 2)</h1><p>链接：<a target="_blank" rel="noopener" href="https://codeforces.com/contest/1511">Educational Codeforces Round 107 (Rated for Div. 2)</a>.<br>闲话：这场打的时候室友在打游戏，加上当时有好几个作业没写，还迟到了十几分钟，心里慌得很想快点切几题去补作业。没想到bc题憋到嘴边出不来，那种要差一点就写出来的感觉可真难受，看到题目想了一会这次还以为能切3题了，没想到还是停在A，依旧是十分钟过A一小时罚坐。所以说再提醒自己一句：<strong>心态很重要！</strong></p>
<h1 id="A-Review-Site（思维-贪心）"><a href="#A-Review-Site（思维-贪心）" class="headerlink" title="A. Review Site（思维+贪心）"></a>A. Review Site（思维+贪心）</h1><p>链接：<a target="_blank" rel="noopener" href="https://codeforces.com/contest/1511/problem/A">A. Review Site</a><br>题意：t组样例，每组样例输入n和n个整数，该整数为1或2或3。<br>题目意思是有两个服务器和n个观众评价电影，每个观众有个代号即上述1~3的整数。当代号：<br>为1时：选择某个服务器，给它点赞。<br>为2时：选择某个服务器，给它点踩。<br>为3时：选择某个服务器，若踩大于赞则点踩，否则点赞。<br>其中服务器的选择由你决定，输出点赞最大值。<br>题解：签到，1和3就能点赞。<br>为什么呢？因为你可以把2都放到一边，1放到另一边，3也放到1这一边，那么3进入时只要有1进入过就能点赞，这样子能使3成为点赞的次数最大。此时能使最多人都点赞。</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br></pre></td><td class="code"><pre><code class="hljs javascript">        <span class="hljs-comment">// violet apricity</span><br><span class="hljs-comment">// Do all I can do.Do good to be good.</span><br> <br>#include&lt;iostream&gt;<br>#include&lt;stdio.h&gt;<br>#include&lt;cstring&gt;<br>#include&lt;string&gt;<br>#include&lt;algorithm&gt;<br>#include&lt;vector&gt;<br>#include&lt;math.h&gt;<br>#include&lt;map&gt;<br>#include&lt;sstream&gt;<br> <br>#define STD using namespace std;<br>#define ll long long<br>#define db double<br>#define ldb long double<br>#define IOS std::ios::sync_with_stdio(<span class="hljs-literal">false</span>),<span class="hljs-attr">std</span>::cin.tie(<span class="hljs-number">0</span>),<span class="hljs-attr">std</span>::cout.tie(<span class="hljs-number">0</span>);<br>#define MAX <span class="hljs-number">88888888</span><br>#define INF <span class="hljs-number">0x3f</span><br>#define r0 <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>;<br>#define SYP system(<span class="hljs-string">&quot;pause&quot;</span>);<br>#define endl <span class="hljs-string">&#x27;\n&#x27;</span><br> <br>STD<br>int main()<br>&#123;<br>    <span class="hljs-comment">//IOS</span><br>    ll t,m;<br>    cin &gt;&gt; t;<br>    <span class="hljs-keyword">while</span> (t--) &#123;<br>        ll ans = <span class="hljs-number">0</span>;<br>        cin &gt;&gt; m;<br>        <span class="hljs-keyword">while</span>(m--)&#123;<br>            ll n;<br>            cin &gt;&gt; n;<br>            <span class="hljs-keyword">if</span> (n == <span class="hljs-number">1</span> || n == <span class="hljs-number">3</span>)<br>                ans++;<br>        &#125;<br>        cout &lt;&lt; ans &lt;&lt; endl;<br>    &#125;<br>    <span class="hljs-comment">//SYP</span><br>    <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>;<br>&#125;<br></code></pre></td></tr></table></figure>

<h1 id="B-GCD-Length（构造-数学）"><a href="#B-GCD-Length（构造-数学）" class="headerlink" title="B. GCD Length（构造+数学）"></a>B. GCD Length（构造+数学）</h1><p>链接：<a target="_blank" rel="noopener" href="https://codeforces.com/contest/1511/problem/B">B. GCD Length</a><br>题意：t组样例，每组输入a，b，c求三个十进制数x，y，z满足：<br>1.x位数为a<br>2.y位数为b<br>3.z位数为c<br>4.gcd(x,y)=z<br>输出x和y。<br>题解：构造题。此题做法有很多，因为答案也有很多种，这里举两种。<br>一种是干脆只用0和1来构造，另一种下面给出。<br>我们知道，要枚举x和y是不可能的，那么我们可以从z出发往x和y构造，又因为gcd(x,y)=z，所以可以确定一下z，假设z=tc=10^(c-1)，那么有x=t<em>tc,y=k</em>tc，我们只要求出t和k就可以了。这里我们重新设下变量t=x,k=y。<br>由于gcd的关系，x和y都应该是质数且x!=y（若x=y则gcd(x,y)=x=y）。<br>那么就好办了，找到x和y的下界，然后判断一下是否为质数，不为质数就+1，并且不能相等。<br>接下来就得解决一下下界寻找的问题了。我们知道10 ^ (a-1)&lt;=x*tc，而tc=10 ^ (c-1)，那么x&gt;=10^(a-c)，下界就是10 ^ (a-c)。问题就迎刃而解啦。<br>下面贴代码吧：</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br></pre></td><td class="code"><pre><code class="hljs javascript">        <span class="hljs-comment">// violet apricity</span><br><span class="hljs-comment">// Do all I can do.Do good to be good.</span><br><br>#include&lt;iostream&gt;<br>#include&lt;stdio.h&gt;<br>#include&lt;cstring&gt;<br>#include&lt;string&gt;<br>#include&lt;algorithm&gt;<br>#include&lt;vector&gt;<br>#include&lt;math.h&gt;<br>#include&lt;map&gt;<br>#include&lt;sstream&gt;<br><br>#define STD using namespace std;<br>#define ll long long<br>#define db double<br>#define ldb long double<br>#define IOS std::ios::sync_with_stdio(<span class="hljs-literal">false</span>),<span class="hljs-attr">std</span>::cin.tie(<span class="hljs-number">0</span>),<span class="hljs-attr">std</span>::cout.tie(<span class="hljs-number">0</span>);<br>#define MAX <span class="hljs-number">88888888</span><br>#define INF <span class="hljs-number">0x3f</span><br>#define r0 <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>;<br>#define SYP system(<span class="hljs-string">&quot;pause&quot;</span>);<br>#define endl <span class="hljs-string">&#x27;\n&#x27;</span><br><br>ll <span class="hljs-function"><span class="hljs-title">qpow</span>(<span class="hljs-params">ll x, ll y</span>)</span> &#123; ll ans = <span class="hljs-number">1</span>; <span class="hljs-keyword">for</span> (; y &gt; <span class="hljs-number">0</span>; y &gt;&gt;= <span class="hljs-number">1</span>) &#123; <span class="hljs-keyword">if</span> (y &amp; <span class="hljs-number">1</span>)ans *= x; x *= x; &#125;<span class="hljs-keyword">return</span> ans; &#125;<br>bool isprime(ll x)<br>&#123;<br>    <span class="hljs-keyword">if</span>(x==<span class="hljs-number">2</span>)<span class="hljs-keyword">return</span> <span class="hljs-number">1</span>;<br>    <span class="hljs-keyword">if</span>(x%<span class="hljs-number">2</span>==<span class="hljs-number">0</span>||x&lt;=<span class="hljs-number">1</span>)<span class="hljs-keyword">return</span> <span class="hljs-number">0</span>;<br>    <span class="hljs-keyword">for</span>(int i=<span class="hljs-number">2</span>;i*i&lt;=x;i++)&#123;<br>        <span class="hljs-keyword">if</span>(x%i==<span class="hljs-number">0</span>)<span class="hljs-keyword">return</span> <span class="hljs-number">0</span>;<br>    &#125;<br>    <span class="hljs-keyword">return</span> <span class="hljs-number">1</span>;<br>&#125;<br>int main()<br>&#123;<br>    IOS<br>    int t;std::cin&gt;&gt;t;<br>    <span class="hljs-keyword">while</span>(t--)&#123;<br>    int a,b,c;<br>    std::cin&gt;&gt;a&gt;&gt;b&gt;&gt;c;<br>    ll tc=qpow(<span class="hljs-number">10</span>,c-<span class="hljs-number">1</span>);<br>    ll x=qpow(<span class="hljs-number">10</span>,a-c),y=qpow(<span class="hljs-number">10</span>,b-c);<br>    <span class="hljs-keyword">while</span>(!isprime(x))++x;<br>    <span class="hljs-keyword">while</span>(x==y||!isprime(y))++y;<br>    std::cout&lt;&lt;x*tc&lt;&lt;<span class="hljs-string">&#x27; &#x27;</span>&lt;&lt;y*tc&lt;&lt;<span class="hljs-string">&#x27;\n&#x27;</span>;<br>    &#125;<br>    SYP<br>    <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>;<br>&#125;<br></code></pre></td></tr></table></figure>

<p>这题很妙的，比赛的时候因为比较急躁没做出来，后来上英语课的时候分析了一下得出答案来。不得不感慨秒的很啊！。</p>
<h1 id="C-Yet-Another-Card-Deck"><a href="#C-Yet-Another-Card-Deck" class="headerlink" title="C. Yet Another Card Deck"></a>C. Yet Another Card Deck</h1><p>链接：<a target="_blank" rel="noopener" href="https://codeforces.com/contest/1511/problem/C">C. Yet Another Card Deck</a><br>题意：给出一个长为n的序列，进行q次询问，每次询问输入整数m找到最靠前的m，输出它的位置并将它提到序列最前方。<br>样例如下：<br><img src="https://img-blog.csdnimg.cn/20210415195605969.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl81MDI4MTg2OQ==,size_16,color_FFFFFF,t_70" srcset="/img/loading.gif" lazyload alt="样例"><br>题解：这题比赛的时候放着b不管硬怼，结果就到快要出答案的地方过不了。其实也不是很难得题，稍微想一想就出答案得了。<br>这里给出两种解法。</p>
<h2 id="解法一"><a href="#解法一" class="headerlink" title="解法一"></a>解法一</h2><p>在输入时记录下每个数第一次出现的位置，因为我们知道每次询问会把那个数字提前，那么与它相同且在它后面得数字永远也用不到，所以没必要存下来。在输出答案时直接输出，然后将位置在次数前面的数位置全部加一，之后把该数位置改为1就可以了。很简单，比赛的时候也是这么想的，但是心急出了bug没实现出来。<br>这个解法可行在于输入的数字范围很小，所以可以遍历找出每个数的位置关系然后进行修改，所以说<strong>题目的数据范围很重要</strong>。</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br></pre></td><td class="code"><pre><code class="hljs javascript">        <span class="hljs-comment">// violet apricity</span><br><span class="hljs-comment">// Do all I can do.Do good to be good.</span><br><br>#include&lt;iostream&gt;<br>#include&lt;stdio.h&gt;<br>#include&lt;cstring&gt;<br>#include&lt;string&gt;<br>#include&lt;algorithm&gt;<br>#include&lt;vector&gt;<br>#include&lt;math.h&gt;<br>#include&lt;map&gt;<br>#include&lt;sstream&gt;<br><br>#define STD using namespace std;<br>#define ll long long<br>#define db double<br>#define ldb long double<br>#define IOS std::ios::sync_with_stdio(<span class="hljs-literal">false</span>),<span class="hljs-attr">std</span>::cin.tie(<span class="hljs-number">0</span>),<span class="hljs-attr">std</span>::cout.tie(<span class="hljs-number">0</span>);<br>#define MAX <span class="hljs-number">88888888</span><br>#define INF <span class="hljs-number">0x3f</span><br>#define r0 <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>;<br>#define SYP system(<span class="hljs-string">&quot;pause&quot;</span>);<br>#define endl <span class="hljs-string">&#x27;\n&#x27;</span><br><br><br><br>int a[<span class="hljs-number">55</span>];<br>int main()<br>&#123;<br>    <span class="hljs-comment">//IOS</span><br>    int n,q;<br>    std::cin&gt;&gt;n&gt;&gt;q;<br>    <span class="hljs-keyword">for</span>(int i=<span class="hljs-number">1</span>;i&lt;=n;i++)&#123;<br>        int x;std::cin&gt;&gt;x;<br>        <span class="hljs-keyword">if</span>(a[x]==<span class="hljs-number">0</span>)a[x]=i;<br>    &#125;<br>    <span class="hljs-keyword">while</span>(q--)&#123;<br>        int x;std::cin&gt;&gt;x;std::cout&lt;&lt;a[x]&lt;&lt;<span class="hljs-string">&#x27; &#x27;</span>;<br>        <span class="hljs-keyword">for</span>(int i=<span class="hljs-number">0</span>;i&lt;=<span class="hljs-number">50</span>;i++)&#123;<br>            <span class="hljs-keyword">if</span>(a[i]!=<span class="hljs-number">0</span>&amp;&amp;a[i]&lt;a[x])a[i]++;<br>        &#125;<br>        a[x]=<span class="hljs-number">1</span>;<br>    &#125;<br>    std::cout&lt;&lt;<span class="hljs-string">&#x27;\n&#x27;</span>;<br>    <span class="hljs-comment">//SYP</span><br>    <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>;<br>&#125;<br></code></pre></td></tr></table></figure>

<h2 id="解法二"><a href="#解法二" class="headerlink" title="解法二"></a>解法二</h2><p>在一篇博客上看到的，贴下<a target="_blank" rel="noopener" href="https://www.cnblogs.com/2aptx4869/p/14652615.html">原文</a>。<br>原文是这样子讲的：<br><img src="https://img-blog.csdnimg.cn/20210415201202361.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl81MDI4MTg2OQ==,size_16,color_FFFFFF,t_70" srcset="/img/loading.gif" lazyload alt="解"><br>再往下比赛的时候没看，所以就不写啦。<br>开始感受到打cf的快感了，继续加油，先定个小目标，每场切个abc。</p>

            </div>
            <hr>
            <div>
              <div class="post-metas mb-3">
                
                
                  <div class="post-meta">
                    <i class="iconfont icon-tags"></i>
                    
                      <a class="hover-with-bg" href="/tags/ACM/">ACM</a>
                    
                      <a class="hover-with-bg" href="/tags/codeforces/">codeforces</a>
                    
                  </div>
                
              </div>
              
                <p class="note note-warning">
                  
                    本博客所有文章除特别声明外，均采用 <a target="_blank" href="https://creativecommons.org/licenses/by-sa/4.0/deed.zh" rel="nofollow noopener noopener">CC BY-SA 4.0 协议</a> ，转载请注明出处！
                  
                </p>
              
              
                <div class="post-prevnext">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/2021/04/16/GZHU2021week7/">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">广州大学ACM2021第七周训练2021.04.13</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/2021/04/16/Codeforces-Round-714-Div-2-Editorial-2021-04-12/">
                        <span class="hidden-mobile">CFR714(Div. 2)2021.04.12</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
          </article>
        </div>
      </div>
    </div>
    
      <div class="d-none d-lg-block col-lg-2 toc-container" id="toc-ctn">
        <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;目录</p>
  <div class="toc-body" id="toc-body"></div>
</div>

      </div>
    
  </div>
</div>

<!-- Custom -->


    

    
      <a id="scroll-top-button" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v"
                 for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>
    

    
  </main>

  <footer class="text-center mt-5 py-3">
  <div class="footer-content">
     <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> 
  </div>
  

  

  
</footer>


  <!-- SCRIPTS -->
  
  <script  src="https://cdn.jsdelivr.net/npm/nprogress@0.2.0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/nprogress@0.2.0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js" ></script>
<script  src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.min.js" ></script>
<script  src="/js/debouncer.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>

<!-- Plugins -->


  
    <script  src="/js/img-lazyload.js" ></script>
  



  



  <script  src="https://cdn.jsdelivr.net/npm/tocbot@4.12.0/dist/tocbot.min.js" ></script>



  <script  src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js" ></script>



  <script  src="https://cdn.jsdelivr.net/npm/anchor-js@4.3.0/anchor.min.js" ></script>



  <script defer src="https://cdn.jsdelivr.net/npm/clipboard@2.0.6/dist/clipboard.min.js" ></script>






  <script  src="https://cdn.jsdelivr.net/npm/typed.js@2.0.11/lib/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var title = document.getElementById('subtitle').title;
      
      typing(title)
      
    })(window, document);
  </script>



  <script  src="/js/local-search.js" ></script>
  <script>
    (function () {
      var path = "/local-search.xml";
      $('#local-search-input').on('click', function() {
        searchFunc(path, 'local-search-input', 'local-search-result');
      });
      $('#modalSearch').on('shown.bs.modal', function() {
        $('#local-search-input').focus();
      });
    })()
  </script>















<!-- 主题的启动项 保持在最底部 -->
<script  src="/js/boot.js" ></script>


</body>
</html>
